#!/usr/bin/env python
# -*- coding: utf-8 -*-
import hashlib
import json
import flask_restful as restful
from flask import Blueprint, current_app, g, request


bp = Blueprint('api_misc', __name__)


class IndexView(restful.Resource):

    def get(self):
        resp = dict(code=0, message='success')
        c = current_app.config
        resp['data'] = dict(
            env=c['RUN_ENV'],
            platform=c['PROJECT'],
            desc='this is api'
        )
        return resp


misc = restful.Api(bp, prefix='')


misc.add_resource(IndexView, '', endpoint='index')